import { pubRequire } from '@utils/public'
const baseUrl = '/communities'

// 获取商品列表
export function getgoodsList(params, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, params, callbBack, errBack)
}

// 商品上架
export function goodsOn(id, callbBack, errBack) {
  return pubRequire('patch', `${baseUrl}/${id}/on`, {}, callbBack, errBack)
}
// 下架商品
export function goodsOff(id, callbBack, errBack) {
  return pubRequire('patch', `${baseUrl}/${id}/off`, {}, callbBack, errBack)
}
// 分页查询该商品的兑换记录
export function exchangeRecords(id,params, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}/exchange-records`, params, callbBack, errBack)
}
// 删除商品
export function delgoods(id, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, {}, callbBack, errBack)
}


